{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![openclassrooms](https://s3.eu-west-1.amazonaws.com/course.oc-static.com/courses/6204541/1+HnqdJ-5ofxiPP9HIxdNdpw.jpeg)\n",
    "\n",
    "# Initiez-vous à Python pour l'analyse de données\n",
    "\n",
    "## Contrôlez votre code grâce aux structures conditionnelles\n",
    "\n",
    "<br><br>\n",
    "\n",
    "**Gérez un enchaînement de conditions**\n",
    "\n",
    "Exécutez le code suivant :"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "c est entre a et b\n"
     ]
    }
   ],
   "source": [
    "a = 5\n",
    "b = 10\n",
    "c = 7\n",
    "\n",
    "if c < a :\n",
    "    print(\"c est plus petit que a\")\n",
    "    \n",
    "if c > b :\n",
    "    print(\"c est plus grand que b\")\n",
    "    \n",
    "if c > a and c < b :\n",
    "    print(\"c est entre a et b\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A présent, reprenez le code ci dessus, en remplaçant les 3 `if` avec une structure de type `if` / `elif` / `else` plus adaptée. L'affichage au final doit être identique !"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "c est entre a et b\n"
     ]
    }
   ],
   "source": [
    "a = 5\n",
    "b = 10\n",
    "c = 7\n",
    "\n",
    "if c < a:\n",
    "    print(\"c est plus petit que a\")\n",
    "elif c > b:\n",
    "    print(\"c est plus grand que b\")\n",
    "else:\n",
    "    print(\"c est entre a et b\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
